//
//  CellTwoImg.m
//  News
//
//  Created by lanou3g on 15/11/5.
//  Copyright © 2015年 songhaowen. All rights reserved.
//

#import "CellTwoImg.h"
#import "JQnewsModel.h"
#import "UIImageView+WebCache.h"


@interface CellTwoImg ()
@property (strong, nonatomic) IBOutlet UIImageView *img1;
@property (strong, nonatomic) IBOutlet UIImageView *img2;
@property (strong, nonatomic) IBOutlet UILabel *titleL;
@property (strong, nonatomic) IBOutlet UILabel *timeL;
@property (strong, nonatomic) IBOutlet UIImageView *img3;

@end

@implementation CellTwoImg

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

  }



//1.cell重用
+(instancetype)cellWithTableView:(UITableView*)tableView{
    static NSString *cell_id = @"flag";
    CellTwoImg *cell = [tableView dequeueReusableCellWithIdentifier:cell_id];
    
    
    if (!cell) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"CellTwoImg" owner:nil options:nil] lastObject ];
    }
    return cell;
}
//2.初始化
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
     }
    return self;
}

-(void)setUiWith:(JQnewsModel *)model{
    //NSLog(@"%@",model.imgextra);
    //NSString *imgsrc0 = (NSString*)model.imgextra[0][@"imgsrc"];
     NSString *imgsrc1 = (NSString*)model.imgextra[1][@"imgsrc"];
    //[self.img1 sd_setImageWithURL:[NSURL URLWithString:imgsrc0]];
   [self.img2 sd_setImageWithURL:[NSURL URLWithString:imgsrc1]];
    [self.img3 sd_setImageWithURL:[NSURL URLWithString:model.imgsrc]];
    self.titleL.text = model.title;
    self.timeL.text = model.ptime;
  }


@end
